#pragma once
#ifndef _Runlist_h_LW_
#define _Runlist_h_LW_

#include <vector>
#include <QList>
#include <windows.h>
#include "CAttribute.h"

struct NonResidentAttrHdr;
class RunList
{
public:
	
	RunList(NonResidentAttrHdr * owner,UINT32 clusterSize);
	~RunList(void);
	UINT64 getPosOnDisk(UINT64 startByte);
	UINT64 PhyToLogic(UINT64 phyOffset);
	QList<Range> getClusterRange();
	void Combine( RunList runList );
	
private :
	UINT64 _getTailOffset();
	UINT32 _clusterSize;
	struct Run{
		INT64 Offset;
		INT64 Len;
		Run(INT64 offset,INT64 len)
		{
			Offset = offset;
			Len = len;
		}
	};
	QList<Run> _runs;
};

#endif // _Runlist_h_LW_
